Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 23: Adding Fog

../ch23/23fig01.gif
Figure 23.1

A test world for experimenting with fog.

23fig01.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Ambient lighting
        DirectionalLight {
            direction 0.0 -1.0 -1.0
            intensity 0.2
            ambientIntensity 1.0
        },
    # Floor
        Shape {
            appearance Appearance {
                material Material {
                    ambientIntensity 0.5
                    diffuseColor 0.2 0.8 0.2
                }
            }
            geometry Box { size 50.0 0.01 50.0 }
        },
    # Pair of columns
        DEF ColumnPair Group {
            children [
                Transform {
                    translation -4.0 3.0 0.0
                    children DEF Column Shape {
                        appearance Appearance {
                            material Material {
                                diffuseColor 1.0 0.8 0.5
                            }
                        }
                        geometry Cylinder {
                            radius 0.3
                            height 6.0
                        }
                    }
                },
                Transform {
                    translation 4.0 3.0 0.0
                    children USE Column
                }
            ]
        },
    # Several more pairs of columns
        Transform { translation 0.0 0.0  -8.0  children USE ColumnPair },
        Transform { translation 0.0 0.0   8.0  children USE ColumnPair },
        Transform { translation 0.0 0.0 -16.0  children USE ColumnPair },
        Transform { translation 0.0 0.0  16.0  children USE ColumnPair },
        Transform { translation 0.0 0.0 -24.0  children USE ColumnPair },
        Transform { translation 0.0 0.0  24.0  children USE ColumnPair },
    ]
}